﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace GroupCheer.FBGraphAPI
{
    public class FBGraphAPIConfiguration
    {
        #region deleted by Zaric
        //public static string AppID
        //{
        //    get
        //    {
        //        Configuration.FBGraphAPIConfigurationSection configuration =
        //            ConfigurationManager.GetSection(Configuration.FBGraphAPIConfigurationSection.Path) as Configuration.FBGraphAPIConfigurationSection;
        //        return configuration.FBAppID;
        //    }
        //}

        //public static string AppKey
        //{
        //    get
        //    {
        //        Configuration.FBGraphAPIConfigurationSection configuration =
        //            ConfigurationManager.GetSection(Configuration.FBGraphAPIConfigurationSection.Path) as Configuration.FBGraphAPIConfigurationSection;
        //        return configuration.FBAppKey;
        //    }
        //}
        //public static bool EnableAsync
        //{
        //    get
        //    {
        //        Configuration.FBGraphAPIConfigurationSection configuration =
        //            ConfigurationManager.GetSection(Configuration.FBGraphAPIConfigurationSection.Path) as Configuration.FBGraphAPIConfigurationSection;
        //        return configuration.EnableAsync;
        //    }
        //}


        //public static string FBLoginUrl
        //{
        //    get
        //    {
        //        Configuration.FBGraphAPIConfigurationSection configuration =
        //            ConfigurationManager.GetSection(Configuration.FBGraphAPIConfigurationSection.Path) as Configuration.FBGraphAPIConfigurationSection;
        //        string requestUrl = string.Format(configuration.FBLoginUrl, FBGraphAPIConfiguration.AppID);

        //        Configuration.FBGraphAPIPermissionSet permissionSet = configuration.FBGraphAPIPermissionSet;

        //        if (permissionSet.Count > 0)
        //        {
        //            string permissionSetUrlParam = null;

        //            foreach (Configuration.FBGraphAPIPermission permission in permissionSet)
        //            {
        //                permissionSetUrlParam += (string.IsNullOrEmpty(permissionSetUrlParam)) ? permission.Permission : "," + permission.Permission;
        //            }

        //            requestUrl += "&scope=" + permissionSetUrlParam;
        //        }

        //        configuration = null;
        //        return requestUrl;
        //    }
        //}

        //public static string GetFBLoginUrl(string AppID)
        //{
        //    Configuration.FBGraphAPIConfigurationSection configuration =
        //        ConfigurationManager.GetSection(Configuration.FBGraphAPIConfigurationSection.Path) as Configuration.FBGraphAPIConfigurationSection;
        //    string requestUrl = string.Format(configuration.FBLoginUrl, AppID);

        //    Configuration.FBGraphAPIPermissionSet permissionSet = configuration.FBGraphAPIPermissionSet;

        //    if (permissionSet.Count > 0)
        //    {
        //        string permissionSetUrlParam = null;

        //        foreach (Configuration.FBGraphAPIPermission permission in permissionSet)
        //        {
        //            permissionSetUrlParam += (string.IsNullOrEmpty(permissionSetUrlParam)) ? permission.Permission : "," + permission.Permission;
        //        }

        //        requestUrl += "&scope=" + permissionSetUrlParam;
        //    }

        //    configuration = null;
        //    return requestUrl;
        //}

        //public static string FBLoginUrlForAppAuthenticationOnly
        //{
        //    get
        //    {
        //        Configuration.FBGraphAPIConfigurationSection configuration =
        //            ConfigurationManager.GetSection(Configuration.FBGraphAPIConfigurationSection.Path) as Configuration.FBGraphAPIConfigurationSection;
        //        string requestUrl = string.Format(configuration.FBLoginUrlForAppAuthOnly, FBGraphAPIConfiguration.AppID, FBGraphAPIConfiguration.AppKey);

        //        Configuration.FBGraphAPIPermissionSet permissionSet = configuration.FBGraphAPIPermissionSet;

        //        if (permissionSet.Count > 0)
        //        {
        //            string permissionSetUrlParam = null;

        //            foreach (Configuration.FBGraphAPIPermission permission in permissionSet)
        //            {
        //                permissionSetUrlParam += (string.IsNullOrEmpty(permissionSetUrlParam)) ? permission.Permission : "," + permission.Permission;
        //            }

        //            requestUrl += "&scope=" + permissionSetUrlParam;
        //        }

        //        configuration = null;
        //        return requestUrl;
        //    }
        //}

        //public static string GetFBLoginUrlForAppAuthenticationOnly(string AppID, string AppKey)
        //{
        //    Configuration.FBGraphAPIConfigurationSection configuration =
        //        ConfigurationManager.GetSection(Configuration.FBGraphAPIConfigurationSection.Path) as Configuration.FBGraphAPIConfigurationSection;
        //    string requestUrl = string.Format(configuration.FBLoginUrlForAppAuthOnly, AppID, AppKey);

        //    Configuration.FBGraphAPIPermissionSet permissionSet = configuration.FBGraphAPIPermissionSet;

        //    if (permissionSet.Count > 0)
        //    {
        //        string permissionSetUrlParam = null;

        //        foreach (Configuration.FBGraphAPIPermission permission in permissionSet)
        //        {
        //            permissionSetUrlParam += (string.IsNullOrEmpty(permissionSetUrlParam)) ? permission.Permission : "," + permission.Permission;
        //        }

        //        requestUrl += "&scope=" + permissionSetUrlParam;
        //    }

        //    configuration = null;
        //    return requestUrl;
        //}
        #endregion
        public static string FBValidAccessToken{get;set;}
        public static bool EnableAsync
        {
            get
            {
                return false;
            }
        }
    }
}
